package cn.itcast;

public class Exception1 {
    public static void main(String[] args) {
        System.out.println("你好");

        try {
            int a = 3 / 1;
            System.out.println(a);

            int[] nums = new int[]{1, 2, 3};
            System.out.println(nums[nums.length-1]);
        } catch (ArithmeticException e) {
            System.out.println("分母不能0");
        } catch (ArrayIndexOutOfBoundsException ae) {
            System.out.println("数组下标越界");
        } catch (Exception e) {
            System.out.println("系统未知异常");
        }

    }
}
